<?php
class Profile{
	private $id;
	private $label;
	private $comment;
	private $tokens;
	private $available;

	function __construct($id) {

		if (is_int($id)){
			if($id >= 0){
				$this->id=$id;
			}else{
				throw new FieldFormatException($_SESSION['translator']->idVal);
			}
		}else{
			throw new FieldFormatException($_SESSION['translator']->idInt);
		}
	}
	public function getId(){
		return $this->id;
	}
	public function getAvailable(){
		return $this->available;
	}
	function getLabel(){
		return $this->label;
	}
	function getComment(){
		return $this->comment;
	}
	function getTokens(){
		return $this->tokens;
	}
	function setLabel($label){
		$this->label = $label;
	}
	function setComment($comment){
		$this->comment = $comment;
	}
	function setAvailable($bool){
		if($bool==1 || $bool == 0){
			$this->available = $bool;
		}
	}
	function setTokens($tokenarray){
		if(is_array($tokenarray)){
			$bool = true;
			foreach($tokenarray as $token){
				if (!is_a($token,'Token')){
					$bool=false;
				}
			}
			if(!$bool){
				throw new FieldFormatException($_SESSION['translator']->listEx." Token");
			}else{
				$this->tokens = $tokenarray;
			}
		}else{
			throw new FieldFormatException($_SESSION['translator']->arrayErr);
		}

	}
}
?>